
<!DOCTYPE html>
<html>

<head>
<title>Webcam in Cindy JS</title>
<meta charset="UTF-8">
<script type="text/javascript" src="../../build/js/Cindy.js"></script>
<script type="text/javascript" src="../../build/js/CindyGL.js"></script>
<script id="csinit" type="text/x-cindyscript">
video = camera video();
</script>
<script id="csdraw" type="text/x-cindyscript">
if (image ready(video),
  //draw image (A, B, video);
  colorplot(imagergb(A, B, video, #+[sin(#.y),sin(#.x)]/2));
);
</script>
<script type="text/javascript">
var cdy = CindyJS({
  ports: [{id: "CSCanvas", transform:[{visibleRect:[-0.1,15.1,20.1,-0.1]}]}],
  scripts: "cs*",
  language: "en",
  defaultAppearance: {
  },
  geometry: [
    {name:"A", type:"Free", pos:[0,0]},
    {name:"B", type:"Free", pos:[20,0]}
  ],
  use: ["CindyGL"]
});
</script>
</head>

<body style="font-family:Arial;">
  <div id="CSCanvas" style="width:804px; height:604px; border:2px solid black"></div>
</body>

</html>
